#ifdef KITSCHY_DEBUG_MEMORY 
#include "debug_memorymanager.h"
#endif

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "math.h"
#include "pthread.h"

#include "BList.h"
#include "BVector.h"
#include "geometrics.h"
#include "quaternion.h"
#include "randomc.h"
#include "symbol.h"
#include "sort.h"
#include "ontology.h"
#include "featureterm.h"
#include "FTKBase.h"

#include "CMC.h"
#include "3dobject.h"
#include "ode/ode.h"
#include "FTGLPolygonFont.h"
#include "AWLocalViewport.h"

#include "AWEntity.h"
#include "AWMessage.h"
#include "AWScenario.h"
#include "AWPlaneScenario.h"
#include "AWMPlaneScenario.h"
#include "AWSelectScenario.h"
#include "AWSelectPlaneScenario.h"
#include "AWSelectMPlaneScenario.h"
#include "AWPhysicalScenario.h" 

#include "AWBody.h"
#include "AWMoveBody.h"
#include "AWMsgBody.h"
#include "AWMsgMoveBody.h"
#include "AWSceneBody.h"
#include "AWPhysicalBody.h"

#include "AWSensor.h"
#include "AWAgentsSensor.h"
#include "AWSelfSensor.h"

#include "AWBrain.h"
#include "AWRandomBrain.h"
#include "AWTracerBrain.h"
#include "AWFileTracerBrain.h"
#include "AWNOOSFileTracerBrain.h"
#include "AWThreadedBrain.h"

#include "AWAgent.h"

#include "AWWorld.h"
#include "AWViewMessageWorld.h"
#include "AWSelectWorld.h"
#include "AWViewMessageSelectWorld.h"
#include "AWPhysicalWorld.h"

// MAC Systems:

#include "AWNOOSAgent.h"
#include "AWNOOSBrain.h"
#include "AWNOOSCBBody.h"



#define AW_INCLUDE_PART

#include "AwApp.h"

#undef AW_INCLUDE_PART




void *ClassLoader(FILE *fp,Ontology *O,FTKBase *Memory,void *extra1 = 0)
{
	Symbol *s;
	char name[256];

	s=new Symbol(fp);
	strcpy(name,s->get());
	delete s;

	if (strcmp(name,"AW_Entity")==0) {
		AW_Entity *tmp=new AW_Entity(fp);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_Scenario")==0) {
		AW_Scenario *tmp=new AW_Scenario(fp);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_PlaneScenario")==0) {
		AW_PlaneScenario *tmp=new AW_PlaneScenario(fp);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_MPlaneScenario")==0) {
		AW_MPlaneScenario *tmp=new AW_MPlaneScenario(fp);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_Body")==0) {
		AW_Body *tmp=new AW_Body(fp,O,Memory);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_MoveBody")==0) {
		AW_MoveBody *tmp=new AW_MoveBody(fp,O,Memory);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_MsgBody")==0) {
		AW_MsgBody *tmp=new AW_MsgBody(fp,O,Memory);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_MsgMoveBody")==0) {
		AW_MsgMoveBody *tmp=new AW_MsgMoveBody(fp,O,Memory);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_Sensor")==0) {
		AW_Sensor *tmp=new AW_Sensor(fp,O,Memory);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_AgentsSensor")==0) {
		AW_AgentsSensor *tmp=new AW_AgentsSensor(fp,O,Memory);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_SelfSensor")==0) {
		AW_SelfSensor *tmp=new AW_SelfSensor(fp,O,Memory);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_Agent")==0) {
		AW_Agent *tmp=new AW_Agent(fp);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_Brain")==0) {
		AW_Brain *tmp=new AW_Brain(fp,O,Memory);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_RandomBrain")==0) {
		AW_RandomBrain *tmp=new AW_RandomBrain(fp,O,Memory);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_TracerBrain")==0) {
		AW_TracerBrain *tmp=new AW_TracerBrain(fp,O,Memory);
		return (void *)tmp;
	} /* if */ 
	
	if (strcmp(name,"AW_FileTracerBrain")==0) {
		AW_FileTracerBrain *tmp=new AW_FileTracerBrain(fp,O,Memory);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_ThreadedBrain")==0) {
		AW_ThreadedBrain *tmp=new AW_ThreadedBrain(fp,O,Memory,true);	/* By default, threads start with 'pause = true' */ 
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_World")==0) {
		AW_World *tmp=new AW_World(fp);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_ViewMessageWorld")==0) {
		AW_ViewMessageWorld *tmp=new AW_ViewMessageWorld(fp);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_ViewMessageSelectWorld")==0) {
		AW_ViewMessageSelectWorld *tmp=new AW_ViewMessageSelectWorld(fp);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_PhysicalBody")==0) {
		AW_PhysicalBody *tmp=new AW_PhysicalBody(fp,O,Memory);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_PhysicalWorld")==0) {
		AW_PhysicalWorld *tmp=new AW_PhysicalWorld(fp);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_PhysicalScenario")==0) {
		AW_PhysicalScenario *tmp=new AW_PhysicalScenario(fp);
		return (void *)tmp;
	} /* if */ 


	if (strcmp(name,"AW_SelectWorld")==0) {
		AW_SelectWorld *tmp=new AW_SelectWorld(fp);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_SelectScenario")==0) {
		AW_SelectScenario *tmp=new AW_SelectScenario(fp);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_SelectPlaneScenario")==0) {
		AW_SelectPlaneScenario *tmp=new AW_SelectPlaneScenario(fp);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_SelectMPlaneScenario")==0) {
		AW_SelectMPlaneScenario *tmp=new AW_SelectMPlaneScenario(fp);
		return (void *)tmp;
	} /* if */ 

	// MAC Systems:

	if (strcmp(name,"AW_NOOSAgent")==0) {
		AW_NOOSAgent *tmp=new AW_NOOSAgent(fp);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_NOOSBrain")==0) {
		AW_NOOSBrain *tmp=new AW_NOOSBrain(fp,O,Memory,(FTKBase *)extra1,true);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_NOOSFileTracerBrain")==0) {
		AW_NOOSFileTracerBrain *tmp=new AW_NOOSFileTracerBrain(fp,O,Memory);
		return (void *)tmp;
	} /* if */ 

	if (strcmp(name,"AW_NOOSCBBody")==0) {
		AW_NOOSCBBody *tmp=new AW_NOOSCBBody(fp,O,Memory,(FTKBase *)extra1);
		return (void *)tmp;
	} /* if */ 

#define AW_LOADER_PART

#include "AwApp.h"

#undef AW_LOADER_PART

	return 0;
} /* ClassLoader */ 


